%% Author: John
%% Created: 2010-6-9
%% Description: TODO: Add description to ml
-module(ml).

%%
%% Include files
%%

%%
%% Exported Functions
%%
-export([on_exit/2]).

%%
%% API Functions
%%

on_exit(Pid,Fun)->
	spawn(fun()->
				  process_flag(trap_exit,true),
				  link(Pid),
				  receive
					  {'Exit',Pid,Why}->
						  Fun(Why)
				  end
		  end).

%%
%% Local Functions
%%

